package com.redsoil.house.widget;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.TextView;

import com.redsoil.house.R;
import com.zhy.autolayout.AutoLinearLayout;

/**
 * 作者：weidingqiang on 2018/12/16 16:45
 * 邮箱：weidingqiang@163.com
 */

public class PropertyInfoItem extends AutoLinearLayout {

    private AutoLinearLayout property_info_item_layout;

    private TextView property_info_title;

    private TextView property_info_value;

    public PropertyInfoItem(Context context) {
        this(context,null);
    }

    public PropertyInfoItem(Context context, AttributeSet attrs) {
        super(context, attrs);

        LayoutInflater inflater = LayoutInflater.from(context);
        inflater.inflate(R.layout.property_info_item, this, true);

        property_info_item_layout = (AutoLinearLayout) this.findViewById(R.id.property_info_item_layout);

        property_info_title = (TextView) this.findViewById(R.id.property_info_title);
        property_info_value = (TextView) this.findViewById(R.id.property_info_value);

    }

    public void setData(String title, String value, Drawable bg){
        property_info_item_layout.setBackground(bg);
        property_info_title.setText(title);
        property_info_value.setText(value);
    }

    public void setValue(String value){
        property_info_value.setText(value);
    }
}
